from math import sqrt


# 加法
def add(x, y):
    return x + y


# 减法
def sub(x, y):
    return x - y


# 乘法
def mul(x, y):
    return x * y


# 除法
def div(x, y):
    try:
        return x / y
    except ZeroDivisionError:
        print("除数不能为0")


# 整除
def exact_div(x, y):
    try:
        return x // y
    except ZeroDivisionError:
        print("除数不能为0")


# 取余
def remainder(x, y):
    return x % y


# 乘方
def power(x, y):
    return x ** y


# 开方
def extract(x):
    return sqrt(x)


if __name__ == "__main__":
    print(add(1, 2))
    print(sub(1, 7))
    print(mul(1, 2))
    print(div(1, 0))
    print(exact_div(3, 2))
    print(remainder(1, 2))
    print(power(3, 2))
    print(extract(9))



